﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeSpunSurf : OdGeSurface
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeSpunSurf(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeSpunSurf_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeSpunSurf obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeSpunSurf()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeSpunSurf(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeSpunSurf() : this(GlobalsPINVOKE.new_OdGeSpunSurf__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeSpunSurf(OdGeCurve3d pProfile, OdGePoint3d pBase, OdGeVector3d pAxis) : this(GlobalsPINVOKE.new_OdGeSpunSurf__SWIG_1(OdGeCurve3d.getCPtr(pProfile), OdGePoint3d.getCPtr(pBase), OdGeVector3d.getCPtr(pAxis)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeSpunSurf(OdGeSpunSurf arg0) : this(GlobalsPINVOKE.new_OdGeSpunSurf__SWIG_2(OdGeSpunSurf.getCPtr(arg0)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeSpunSurf Assign(OdGeSpunSurf extCurve)
		{
			OdGeSpunSurf result = new OdGeSpunSurf(GlobalsPINVOKE.OdGeSpunSurf_Assign(this.swigCPtr, OdGeSpunSurf.getCPtr(extCurve)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCurve3d getProfile()
		{
			OdGeCurve3d result = new OdGeCurve3d(GlobalsPINVOKE.OdGeSpunSurf_getProfile(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d getBasePoint()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeSpunSurf_getBasePoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d getAxis()
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGeSpunSurf_getAxis(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d getRef()
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGeSpunSurf_getRef(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void set(OdGeCurve3d pProfile, OdGePoint3d pBase, OdGeVector3d pAxis)
		{
			GlobalsPINVOKE.OdGeSpunSurf_set(this.swigCPtr, OdGeCurve3d.getCPtr(pProfile), OdGePoint3d.getCPtr(pBase), OdGeVector3d.getCPtr(pAxis));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
